<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
	  th:with="title='个人信息',active='userinfo'"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<!-- head 头部-->
<head th:replace="web/common/fragment::head(${title},null,'')"></head>
	<body>

		<div th:replace="web/layout/header::header(${active})"></div>
		<!--	main	-->
		<div class="fly-main" th:if="${author!=null}">
			<div class="layui-row clear layui-col-space15">
				<!--	left begin	-->
				<div class="layui-col-sm12 layui-col-md3">
					<div class="layui-card">
						<div class="layui-card-body" style="padding: 25px;">
							<div class="text-center layui-text">
								<div class="user-info-head" id="imgHead">
									<span th:if="${author.userGrade==1}" class="vip-icon"></span>
									<img th:src="${thUtil.formatUserImage(author.userImg)}"/>
								</div>
								<h2 style="padding-top: 20px;" th:class="${author.userGrade==1?'color-vip':''}" th:text="${author.nickName}">Serati Ma</h2>
								<p style="padding-top: 8px;">海纳百川，有容乃大</p>
							</div>
							<div class="layui-text" style="padding-top: 30px;">
								<div class="info-list-item">
									<i class="layui-icon layui-icon-username"></i>
									<p th:text="${author.id}">unknow</p>
								</div>
								<div class="info-list-item">
									<i class="layui-icon layui-icon-release"></i>
									<p th:class="${author.userGrade==1?'color-vip':''}" th:text="${author.userGrade==1?'超级VIP':author.userGrade==2?'至尊VIP':'普通用户'}">用户</p>
								</div>
								<div class="info-list-item">
									<i class="layui-icon layui-icon-location"></i>
									<p th:text="${author.userAddress}">中国</p>
								</div>
							</div>
							<div class="dash"></div>
							<h3>标签</h3>
							<div class="layui-badge-list" style="padding-top: 6px;">
								<span class="layui-badge layui-bg-gray">回帖之王</span>
								<span class="layui-badge layui-bg-gray">发帖之神</span>
								<span class="layui-badge layui-bg-gray">作家</span>
							</div>
						</div>
					</div>
				</div>
				<!--	 left end		-->
				<!--		right begin			-->
				<div class="layui-col-sm12 layui-col-md9">
					<div class="layui-card">
						<div class="layui-card-body" style="min-height: 600px;box-sizing: border-box;padding-top: 5px;">

							<div class="layui-tab layui-tab-brief user-tab">
								<ul class="layui-tab-title">
									<li class="layui-this">基本信息</li>
									<!--<li>浏览记录</li>
									<li>发帖记录</li>
									<li>评论记录</li>-->
								</ul>
								<div class="layui-tab-content">
									<div class="layui-tab-item layui-show">

										<div class="layui-form user-info-form" style="max-width: 400px;padding-top: 25px;">
											<div class="layui-form-item">
												<label class="layui-form-label">邮箱:</label>
												<div class="layui-input-block">
													<input type="text" name="email" th:value="${author.email}"
														   class="layui-input"/>
												</div>
											</div>
											<div class="layui-form-item">
												<label class="layui-form-label">昵称:</label>
												<div class="layui-input-block">
													<input type="text" name="name" th:value="${author.nickName}"
														   class="layui-input" lay-verify="required" required/>
												</div>
											</div>
											<!--<div class="layui-form-item">
                                                <label class="layui-form-label">个人简介:</label>
                                                <div class="layui-input-block">
                                                    <textarea name="desc" placeholder="个人简介" class="layui-textarea"></textarea>
                                                </div>
                                            </div>-->
											<div class="layui-form-item">
												<label class="layui-form-label">地址:</label>
												<div class="layui-input-block">
													<input type="text" name="userAddress" th:value="${author.userAddress}"
														   class="layui-input"/>
												</div>
											</div>
											<div class="layui-form-item">
												<label class="layui-form-label">联系电话:</label>
												<div class="layui-input-block">
													<div style="width: 70%;display: inline-block;margin-right: 6px;">
														<input type="text" name="phone" th:value="${author.phone}"
															   class="layui-input"/>
													</div>
												</div>
											</div>

										</div>

									</div>
									<!--<div class="layui-tab-item" style="padding: 6px 25px 30px 25px;">
										&lt;!&ndash;<table class="layui-table" id="look-table" lay-filter="look-table"></table>&ndash;&gt;
									</div>
									<div class="layui-tab-item" style="padding: 6px 25px 30px 25px;">
										<table class="layui-table" id="post-table" lay-filter="post-table"></table>
									</div>
									<div class="layui-tab-item" style="padding: 6px 25px 30px 25px;">
										<table class="layui-table" id="comment-table" lay-filter="comment-table"></table>
									</div>-->
								</div>
							</div>

						</div>
					</div>
				</div>
				<!--	right end		-->
			</div>


		</div>
		<!--	main end	-->
<!--	底部版权		-->
<div th:replace="web/layout/footer::footer"></div>
<!--	搜索		-->
<div th:replace="web/layout/common::pop-search"></div>
<!--	右边工具栏	-->
<div th:replace="web/layout/common::right-bar"></div>
<!--	引入JS	-->
<div th:replace="web/common/fragment::js"></div>
<!-- 表格操作列 -->
<script type="text/html" id="post-table-bar">
	<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>修改</a>
	<a class="layui-btn layui-btn-danger layui-btn-xs" ajax-event="del" ajax-url="/admin/post/" value="{{d.postId}}">
		<i class="layui-icon layui-icon-delete"></i>删除</a>
</script>
<!--类型-->
<script type="text/html" id="data-table-type">
	{{#  if(d.postType == 0){ }}
	<span class="layui-badge layui-bg-gray">普通文章</span>
	{{#  } else if(d.postType == 1){ }}
	<span class="layui-badge">付费文章</span>
	{{#  } else if(d.postType == 2){ }}
	<span class="layui-badge layui-bg-blue">登陆可见</span>
	{{#  } else if(d.postType == 3){ }}
	<span class="layui-badge layui-bg-green">回复可见</span>
	{{#  } else{ }}
	unkown
	{{#  }}}
</script>
<script type="text/html" id="data-table-target">
	{{#  if(d.target == "_self"){ }}
	当前窗口打开
	{{#  } else if(d.target == "_blank"){ }}
	新窗口打开
	{{#  } else{ }}
	unkown
	{{#  }}}
</script>
<script type="text/javascript" th:inline="javascript">
	var authorId = [[${authorId}]];
    layui.use(['layer', 'form', 'element', 'upload','table','util'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var element = layui.element;
        var upload = layui.upload;
		var table = layui.table;
		var util = layui.util;

		var tableIns = table.render({
			elem: '#post-table',
			url: '/post/list?userId='+authorId,
			page : true,
			loading : true,
			limit : 10,
			limits : [ 10, 20, 50, 100 ],
			response:{
				countName: 'total'
			},
			cols: [
				[
					{type: 'numbers'},
					{field: 'postTitle',width:360, title: '文章名',templet: function (d) {
							return '['+d.catalog.catalogName+']<a href="/post/'+ d.postId +'" target="_blank" style="text-decoration: underline">'+d.postTitle+'</a>';
						}},
					{field: 'commentCount',width:60,sort:true, title: '回复数'},
					{field: 'createTime',width:160,title: '创建时间', sort: true, templet: function (d) {
							return util.toDateString(d.createTime);
						}
					}
				]
			],
			text: {
				none: '暂无相关数据'
			}
		});


    });
</script>
<div th:replace="web/common/fragment::post"></div>

	</body>
</html>
